package descentFly.away3D4.helpers
{
	import away3d.containers.ObjectContainer3D;
	import away3d.materials.MaterialBase;
	import away3d.primitives.Cone;
	import away3d.primitives.Cube;
	import away3d.primitives.Cylinder;
	import away3d.primitives.Sphere;
	
	public class df_arrow extends ObjectContainer3D {
		private var _basePoint	: Cube;
		private var _direct		: Cylinder;
		private var _arrow		: Cone;
		private var _size		: Number;
		private var _mat		: MaterialBase;
		
		public function df_arrow(a_mat: MaterialBase, a_size: Number) {
			super();
			_mat	= a_mat;
			size 	= a_size;
		}
		
		public function get size(): Number {
			return _size;
		}

		public function set size(a_size: Number): void {
			if (_size != a_size) resize(a_size)
		}
		
		protected function resize(a_size: Number): void {
			_size = a_size;
			if (!_basePoint) {
				_basePoint = new Cube(_mat, size / 10, size / 10, size / 10);
				addChild(_basePoint);
			}
		}
	}
}